// $ANTLR 3.0.1 Grin.g 2007-12-12 17:16:05

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
public class GrinParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "STYLE_TYPE", "WORD", "NEWLINE", "WS", "'#'", "':'", "'{'", "';'", "'}'", "'@'", "'text'", "'endtext'", "'image'", "'label'", "'endlabel'", "'play'", "'stop'"
    };
    public static final int WORD=5;
    public static final int WS=7;
    public static final int NEWLINE=6;
    public static final int EOF=-1;
    public static final int STYLE_TYPE=4;

        public GrinParser(TokenStream input) {
            super(input);
            ruleMemo = new HashMap[29+1];
         }
        

    public String[] getTokenNames() { return tokenNames; }
    public String getGrammarFileName() { return "Grin.g"; }



    // $ANTLR start grin
    // Grin.g:12:1: grin : ( comment | directive | style_definition )* ;
    public final void grin() throws RecognitionException {
        try {
            // Grin.g:12:5: ( ( comment | directive | style_definition )* )
            // Grin.g:12:7: ( comment | directive | style_definition )*
            {
            // Grin.g:12:7: ( comment | directive | style_definition )*
            loop1:
            do {
                int alt1=4;
                switch ( input.LA(1) ) {
                case EOF:
                    {
                    int LA1_1 = input.LA(2);

                    if ( (synpred2()) ) {
                        alt1=2;
                    }


                    }
                    break;
                case 8:
                    {
                    int LA1_2 = input.LA(2);

                    if ( (synpred1()) ) {
                        alt1=1;
                    }
                    else if ( (synpred2()) ) {
                        alt1=2;
                    }


                    }
                    break;
                case WORD:
                case 10:
                case 14:
                case 16:
                case 17:
                case 19:
                    {
                    alt1=2;
                    }
                    break;
                case 13:
                    {
                    int LA1_4 = input.LA(2);

                    if ( (synpred2()) ) {
                        alt1=2;
                    }
                    else if ( (synpred3()) ) {
                        alt1=3;
                    }


                    }
                    break;

                }

                switch (alt1) {
            	case 1 :
            	    // Grin.g:12:8: comment
            	    {
            	    pushFollow(FOLLOW_comment_in_grin28);
            	    comment();
            	    _fsp--;
            	    if (failed) return ;

            	    }
            	    break;
            	case 2 :
            	    // Grin.g:12:18: directive
            	    {
            	    pushFollow(FOLLOW_directive_in_grin32);
            	    directive();
            	    _fsp--;
            	    if (failed) return ;

            	    }
            	    break;
            	case 3 :
            	    // Grin.g:12:30: style_definition
            	    {
            	    pushFollow(FOLLOW_style_definition_in_grin36);
            	    style_definition();
            	    _fsp--;
            	    if (failed) return ;

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end grin


    // $ANTLR start comment
    // Grin.g:14:1: comment : '#' phrase ;
    public final void comment() throws RecognitionException {
        try {
            // Grin.g:14:8: ( '#' phrase )
            // Grin.g:14:10: '#' phrase
            {
            match(input,8,FOLLOW_8_in_comment45); if (failed) return ;
            pushFollow(FOLLOW_phrase_in_comment47);
            phrase();
            _fsp--;
            if (failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end comment


    // $ANTLR start style
    // Grin.g:16:1: style : STYLE_TYPE ':' phrase ;
    public final void style() throws RecognitionException {
        try {
            // Grin.g:16:6: ( STYLE_TYPE ':' phrase )
            // Grin.g:16:8: STYLE_TYPE ':' phrase
            {
            match(input,STYLE_TYPE,FOLLOW_STYLE_TYPE_in_style54); if (failed) return ;
            match(input,9,FOLLOW_9_in_style56); if (failed) return ;
            pushFollow(FOLLOW_phrase_in_style58);
            phrase();
            _fsp--;
            if (failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end style


    // $ANTLR start inline_style_use
    // Grin.g:17:1: inline_style_use : '{' ( style ';' )* style ( ';' )? '}' ;
    public final void inline_style_use() throws RecognitionException {
        try {
            // Grin.g:17:17: ( '{' ( style ';' )* style ( ';' )? '}' )
            // Grin.g:17:19: '{' ( style ';' )* style ( ';' )? '}'
            {
            match(input,10,FOLLOW_10_in_inline_style_use64); if (failed) return ;
            // Grin.g:17:23: ( style ';' )*
            loop2:
            do {
                int alt2=2;
                alt2 = dfa2.predict(input);
                switch (alt2) {
            	case 1 :
            	    // Grin.g:17:24: style ';'
            	    {
            	    pushFollow(FOLLOW_style_in_inline_style_use67);
            	    style();
            	    _fsp--;
            	    if (failed) return ;
            	    match(input,11,FOLLOW_11_in_inline_style_use69); if (failed) return ;

            	    }
            	    break;

            	default :
            	    break loop2;
                }
            } while (true);

            pushFollow(FOLLOW_style_in_inline_style_use73);
            style();
            _fsp--;
            if (failed) return ;
            // Grin.g:17:42: ( ';' )?
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( (LA3_0==11) ) {
                alt3=1;
            }
            switch (alt3) {
                case 1 :
                    // Grin.g:0:0: ';'
                    {
                    match(input,11,FOLLOW_11_in_inline_style_use75); if (failed) return ;

                    }
                    break;

            }

            match(input,12,FOLLOW_12_in_inline_style_use78); if (failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end inline_style_use


    // $ANTLR start style_name
    // Grin.g:18:1: style_name : '@' WORD ;
    public final void style_name() throws RecognitionException {
        try {
            // Grin.g:18:11: ( '@' WORD )
            // Grin.g:18:13: '@' WORD
            {
            match(input,13,FOLLOW_13_in_style_name85); if (failed) return ;
            match(input,WORD,FOLLOW_WORD_in_style_name87); if (failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end style_name


    // $ANTLR start style_definition
    // Grin.g:19:1: style_definition : style_name inline_style_use ;
    public final void style_definition() throws RecognitionException {
        try {
            // Grin.g:19:17: ( style_name inline_style_use )
            // Grin.g:19:19: style_name inline_style_use
            {
            pushFollow(FOLLOW_style_name_in_style_definition93);
            style_name();
            _fsp--;
            if (failed) return ;
            pushFollow(FOLLOW_inline_style_use_in_style_definition95);
            inline_style_use();
            _fsp--;
            if (failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end style_definition


    // $ANTLR start style_use
    // Grin.g:20:1: style_use : ( inline_style_use | style_name );
    public final void style_use() throws RecognitionException {
        try {
            // Grin.g:20:10: ( inline_style_use | style_name )
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( (LA4_0==10) ) {
                alt4=1;
            }
            else if ( (LA4_0==13) ) {
                alt4=2;
            }
            else {
                if (backtracking>0) {failed=true; return ;}
                NoViableAltException nvae =
                    new NoViableAltException("20:1: style_use : ( inline_style_use | style_name );", 4, 0, input);

                throw nvae;
            }
            switch (alt4) {
                case 1 :
                    // Grin.g:20:12: inline_style_use
                    {
                    pushFollow(FOLLOW_inline_style_use_in_style_use101);
                    inline_style_use();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;
                case 2 :
                    // Grin.g:20:31: style_name
                    {
                    pushFollow(FOLLOW_style_name_in_style_use105);
                    style_name();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end style_use


    // $ANTLR start directive
    // Grin.g:22:1: directive : ( style_use )? ( text | image | label | play ) ;
    public final void directive() throws RecognitionException {
        try {
            // Grin.g:22:10: ( ( style_use )? ( text | image | label | play ) )
            // Grin.g:22:12: ( style_use )? ( text | image | label | play )
            {
            // Grin.g:22:12: ( style_use )?
            int alt5=2;
            int LA5_0 = input.LA(1);

            if ( (LA5_0==10) ) {
                int LA5_1 = input.LA(2);

                if ( (synpred7()) ) {
                    alt5=1;
                }
            }
            else if ( (LA5_0==13) ) {
                int LA5_2 = input.LA(2);

                if ( (synpred7()) ) {
                    alt5=1;
                }
            }
            switch (alt5) {
                case 1 :
                    // Grin.g:0:0: style_use
                    {
                    pushFollow(FOLLOW_style_use_in_directive112);
                    style_use();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;

            }

            // Grin.g:22:23: ( text | image | label | play )
            int alt6=4;
            switch ( input.LA(1) ) {
            case EOF:
            case WORD:
            case NEWLINE:
            case 8:
            case 10:
            case 13:
            case 14:
                {
                alt6=1;
                }
                break;
            case 16:
                {
                int LA6_2 = input.LA(2);

                if ( (synpred8()) ) {
                    alt6=1;
                }
                else if ( (synpred9()) ) {
                    alt6=2;
                }
                else {
                    if (backtracking>0) {failed=true; return ;}
                    NoViableAltException nvae =
                        new NoViableAltException("22:23: ( text | image | label | play )", 6, 2, input);

                    throw nvae;
                }
                }
                break;
            case 17:
                {
                int LA6_3 = input.LA(2);

                if ( (synpred8()) ) {
                    alt6=1;
                }
                else if ( (synpred10()) ) {
                    alt6=3;
                }
                else {
                    if (backtracking>0) {failed=true; return ;}
                    NoViableAltException nvae =
                        new NoViableAltException("22:23: ( text | image | label | play )", 6, 3, input);

                    throw nvae;
                }
                }
                break;
            case 19:
                {
                int LA6_4 = input.LA(2);

                if ( (synpred8()) ) {
                    alt6=1;
                }
                else if ( (true) ) {
                    alt6=4;
                }
                else {
                    if (backtracking>0) {failed=true; return ;}
                    NoViableAltException nvae =
                        new NoViableAltException("22:23: ( text | image | label | play )", 6, 4, input);

                    throw nvae;
                }
                }
                break;
            default:
                if (backtracking>0) {failed=true; return ;}
                NoViableAltException nvae =
                    new NoViableAltException("22:23: ( text | image | label | play )", 6, 0, input);

                throw nvae;
            }

            switch (alt6) {
                case 1 :
                    // Grin.g:22:24: text
                    {
                    pushFollow(FOLLOW_text_in_directive116);
                    text();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;
                case 2 :
                    // Grin.g:22:29: image
                    {
                    pushFollow(FOLLOW_image_in_directive118);
                    image();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;
                case 3 :
                    // Grin.g:22:35: label
                    {
                    pushFollow(FOLLOW_label_in_directive120);
                    label();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;
                case 4 :
                    // Grin.g:22:41: play
                    {
                    pushFollow(FOLLOW_play_in_directive122);
                    play();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;

            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end directive


    // $ANTLR start text
    // Grin.g:23:1: text : ( phrase | 'text' multi_line_phrase 'endtext' );
    public final void text() throws RecognitionException {
        try {
            // Grin.g:23:5: ( phrase | 'text' multi_line_phrase 'endtext' )
            int alt7=2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0==EOF||(LA7_0>=WORD && LA7_0<=NEWLINE)||LA7_0==8||LA7_0==10||LA7_0==13||(LA7_0>=16 && LA7_0<=17)||LA7_0==19) ) {
                alt7=1;
            }
            else if ( (LA7_0==14) ) {
                int LA7_2 = input.LA(2);

                if ( (synpred11()) ) {
                    alt7=1;
                }
                else if ( (true) ) {
                    alt7=2;
                }
                else {
                    if (backtracking>0) {failed=true; return ;}
                    NoViableAltException nvae =
                        new NoViableAltException("23:1: text : ( phrase | 'text' multi_line_phrase 'endtext' );", 7, 2, input);

                    throw nvae;
                }
            }
            else {
                if (backtracking>0) {failed=true; return ;}
                NoViableAltException nvae =
                    new NoViableAltException("23:1: text : ( phrase | 'text' multi_line_phrase 'endtext' );", 7, 0, input);

                throw nvae;
            }
            switch (alt7) {
                case 1 :
                    // Grin.g:23:7: phrase
                    {
                    pushFollow(FOLLOW_phrase_in_text129);
                    phrase();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;
                case 2 :
                    // Grin.g:23:16: 'text' multi_line_phrase 'endtext'
                    {
                    match(input,14,FOLLOW_14_in_text133); if (failed) return ;
                    pushFollow(FOLLOW_multi_line_phrase_in_text135);
                    multi_line_phrase();
                    _fsp--;
                    if (failed) return ;
                    match(input,15,FOLLOW_15_in_text137); if (failed) return ;

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end text


    // $ANTLR start image
    // Grin.g:24:1: image : 'image' WORD phrase ;
    public final void image() throws RecognitionException {
        try {
            // Grin.g:24:6: ( 'image' WORD phrase )
            // Grin.g:24:8: 'image' WORD phrase
            {
            match(input,16,FOLLOW_16_in_image143); if (failed) return ;
            match(input,WORD,FOLLOW_WORD_in_image145); if (failed) return ;
            pushFollow(FOLLOW_phrase_in_image147);
            phrase();
            _fsp--;
            if (failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end image


    // $ANTLR start label
    // Grin.g:25:1: label : ( 'label' phrase | 'label' multi_line_phrase 'endlabel' );
    public final void label() throws RecognitionException {
        try {
            // Grin.g:25:6: ( 'label' phrase | 'label' multi_line_phrase 'endlabel' )
            int alt8=2;
            alt8 = dfa8.predict(input);
            switch (alt8) {
                case 1 :
                    // Grin.g:25:8: 'label' phrase
                    {
                    match(input,17,FOLLOW_17_in_label153); if (failed) return ;
                    pushFollow(FOLLOW_phrase_in_label155);
                    phrase();
                    _fsp--;
                    if (failed) return ;

                    }
                    break;
                case 2 :
                    // Grin.g:25:25: 'label' multi_line_phrase 'endlabel'
                    {
                    match(input,17,FOLLOW_17_in_label159); if (failed) return ;
                    pushFollow(FOLLOW_multi_line_phrase_in_label161);
                    multi_line_phrase();
                    _fsp--;
                    if (failed) return ;
                    match(input,18,FOLLOW_18_in_label164); if (failed) return ;

                    }
                    break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end label


    // $ANTLR start play
    // Grin.g:26:1: play : 'play' ( directive NEWLINE )* 'stop' ;
    public final void play() throws RecognitionException {
        try {
            // Grin.g:26:5: ( 'play' ( directive NEWLINE )* 'stop' )
            // Grin.g:26:7: 'play' ( directive NEWLINE )* 'stop'
            {
            match(input,19,FOLLOW_19_in_play170); if (failed) return ;
            // Grin.g:26:14: ( directive NEWLINE )*
            loop9:
            do {
                int alt9=2;
                int LA9_0 = input.LA(1);

                if ( ((LA9_0>=WORD && LA9_0<=NEWLINE)||LA9_0==10||(LA9_0>=13 && LA9_0<=14)||(LA9_0>=16 && LA9_0<=17)||LA9_0==19) ) {
                    alt9=1;
                }


                switch (alt9) {
            	case 1 :
            	    // Grin.g:26:15: directive NEWLINE
            	    {
            	    pushFollow(FOLLOW_directive_in_play173);
            	    directive();
            	    _fsp--;
            	    if (failed) return ;
            	    match(input,NEWLINE,FOLLOW_NEWLINE_in_play175); if (failed) return ;

            	    }
            	    break;

            	default :
            	    break loop9;
                }
            } while (true);

            match(input,20,FOLLOW_20_in_play179); if (failed) return ;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end play


    // $ANTLR start phrase
    // Grin.g:28:1: phrase : ( WORD )* ;
    public final void phrase() throws RecognitionException {
        try {
            // Grin.g:28:8: ( ( WORD )* )
            // Grin.g:28:10: ( WORD )*
            {
            // Grin.g:28:10: ( WORD )*
            loop10:
            do {
                int alt10=2;
                int LA10_0 = input.LA(1);

                if ( (LA10_0==WORD) ) {
                    int LA10_2 = input.LA(2);

                    if ( (synpred14()) ) {
                        alt10=1;
                    }


                }


                switch (alt10) {
            	case 1 :
            	    // Grin.g:0:0: WORD
            	    {
            	    match(input,WORD,FOLLOW_WORD_in_phrase187); if (failed) return ;

            	    }
            	    break;

            	default :
            	    break loop10;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end phrase


    // $ANTLR start multi_line_phrase
    // Grin.g:29:1: multi_line_phrase : ( phrase NEWLINE )* ;
    public final void multi_line_phrase() throws RecognitionException {
        try {
            // Grin.g:29:19: ( ( phrase NEWLINE )* )
            // Grin.g:29:21: ( phrase NEWLINE )*
            {
            // Grin.g:29:21: ( phrase NEWLINE )*
            loop11:
            do {
                int alt11=2;
                int LA11_0 = input.LA(1);

                if ( ((LA11_0>=WORD && LA11_0<=NEWLINE)) ) {
                    alt11=1;
                }


                switch (alt11) {
            	case 1 :
            	    // Grin.g:29:22: phrase NEWLINE
            	    {
            	    pushFollow(FOLLOW_phrase_in_multi_line_phrase196);
            	    phrase();
            	    _fsp--;
            	    if (failed) return ;
            	    match(input,NEWLINE,FOLLOW_NEWLINE_in_multi_line_phrase198); if (failed) return ;

            	    }
            	    break;

            	default :
            	    break loop11;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return ;
    }
    // $ANTLR end multi_line_phrase

    // $ANTLR start synpred1
    public final void synpred1_fragment() throws RecognitionException {   
        // Grin.g:12:8: ( comment )
        // Grin.g:12:8: comment
        {
        pushFollow(FOLLOW_comment_in_synpred128);
        comment();
        _fsp--;
        if (failed) return ;

        }
    }
    // $ANTLR end synpred1

    // $ANTLR start synpred2
    public final void synpred2_fragment() throws RecognitionException {   
        // Grin.g:12:18: ( directive )
        // Grin.g:12:18: directive
        {
        pushFollow(FOLLOW_directive_in_synpred232);
        directive();
        _fsp--;
        if (failed) return ;

        }
    }
    // $ANTLR end synpred2

    // $ANTLR start synpred3
    public final void synpred3_fragment() throws RecognitionException {   
        // Grin.g:12:30: ( style_definition )
        // Grin.g:12:30: style_definition
        {
        pushFollow(FOLLOW_style_definition_in_synpred336);
        style_definition();
        _fsp--;
        if (failed) return ;

        }
    }
    // $ANTLR end synpred3

    // $ANTLR start synpred7
    public final void synpred7_fragment() throws RecognitionException {   
        // Grin.g:22:12: ( style_use )
        // Grin.g:22:12: style_use
        {
        pushFollow(FOLLOW_style_use_in_synpred7112);
        style_use();
        _fsp--;
        if (failed) return ;

        }
    }
    // $ANTLR end synpred7

    // $ANTLR start synpred8
    public final void synpred8_fragment() throws RecognitionException {   
        // Grin.g:22:24: ( text )
        // Grin.g:22:24: text
        {
        pushFollow(FOLLOW_text_in_synpred8116);
        text();
        _fsp--;
        if (failed) return ;

        }
    }
    // $ANTLR end synpred8

    // $ANTLR start synpred9
    public final void synpred9_fragment() throws RecognitionException {   
        // Grin.g:22:29: ( image )
        // Grin.g:22:29: image
        {
        pushFollow(FOLLOW_image_in_synpred9118);
        image();
        _fsp--;
        if (failed) return ;

        }
    }
    // $ANTLR end synpred9

    // $ANTLR start synpred10
    public final void synpred10_fragment() throws RecognitionException {   
        // Grin.g:22:35: ( label )
        // Grin.g:22:35: label
        {
        pushFollow(FOLLOW_label_in_synpred10120);
        label();
        _fsp--;
        if (failed) return ;

        }
    }
    // $ANTLR end synpred10

    // $ANTLR start synpred11
    public final void synpred11_fragment() throws RecognitionException {   
        // Grin.g:23:7: ( phrase )
        // Grin.g:23:7: phrase
        {
        pushFollow(FOLLOW_phrase_in_synpred11129);
        phrase();
        _fsp--;
        if (failed) return ;

        }
    }
    // $ANTLR end synpred11

    // $ANTLR start synpred14
    public final void synpred14_fragment() throws RecognitionException {   
        // Grin.g:28:10: ( WORD )
        // Grin.g:28:10: WORD
        {
        match(input,WORD,FOLLOW_WORD_in_synpred14187); if (failed) return ;

        }
    }
    // $ANTLR end synpred14

    public final boolean synpred9() {
        backtracking++;
        int start = input.mark();
        try {
            synpred9_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }
    public final boolean synpred14() {
        backtracking++;
        int start = input.mark();
        try {
            synpred14_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }
    public final boolean synpred7() {
        backtracking++;
        int start = input.mark();
        try {
            synpred7_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }
    public final boolean synpred8() {
        backtracking++;
        int start = input.mark();
        try {
            synpred8_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }
    public final boolean synpred10() {
        backtracking++;
        int start = input.mark();
        try {
            synpred10_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }
    public final boolean synpred1() {
        backtracking++;
        int start = input.mark();
        try {
            synpred1_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }
    public final boolean synpred11() {
        backtracking++;
        int start = input.mark();
        try {
            synpred11_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }
    public final boolean synpred2() {
        backtracking++;
        int start = input.mark();
        try {
            synpred2_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }
    public final boolean synpred3() {
        backtracking++;
        int start = input.mark();
        try {
            synpred3_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !failed;
        input.rewind(start);
        backtracking--;
        failed=false;
        return success;
    }


    protected DFA2 dfa2 = new DFA2(this);
    protected DFA8 dfa8 = new DFA8(this);
    static final String DFA2_eotS =
        "\7\uffff";
    static final String DFA2_eofS =
        "\7\uffff";
    static final String DFA2_minS =
        "\1\4\1\11\2\5\1\4\2\uffff";
    static final String DFA2_maxS =
        "\1\4\1\11\3\14\2\uffff";
    static final String DFA2_acceptS =
        "\5\uffff\1\2\1\1";
    static final String DFA2_specialS =
        "\7\uffff}>";
    static final String[] DFA2_transitionS = {
            "\1\1",
            "\1\2",
            "\1\3\5\uffff\1\4\1\5",
            "\1\3\5\uffff\1\4\1\5",
            "\1\6\7\uffff\1\5",
            "",
            ""
    };

    static final short[] DFA2_eot = DFA.unpackEncodedString(DFA2_eotS);
    static final short[] DFA2_eof = DFA.unpackEncodedString(DFA2_eofS);
    static final char[] DFA2_min = DFA.unpackEncodedStringToUnsignedChars(DFA2_minS);
    static final char[] DFA2_max = DFA.unpackEncodedStringToUnsignedChars(DFA2_maxS);
    static final short[] DFA2_accept = DFA.unpackEncodedString(DFA2_acceptS);
    static final short[] DFA2_special = DFA.unpackEncodedString(DFA2_specialS);
    static final short[][] DFA2_transition;

    static {
        int numStates = DFA2_transitionS.length;
        DFA2_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA2_transition[i] = DFA.unpackEncodedString(DFA2_transitionS[i]);
        }
    }

    class DFA2 extends DFA {

        public DFA2(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 2;
            this.eot = DFA2_eot;
            this.eof = DFA2_eof;
            this.min = DFA2_min;
            this.max = DFA2_max;
            this.accept = DFA2_accept;
            this.special = DFA2_special;
            this.transition = DFA2_transition;
        }
        public String getDescription() {
            return "()* loopback of 17:23: ( style ';' )*";
        }
    }
    static final String DFA8_eotS =
        "\10\uffff";
    static final String DFA8_eofS =
        "\1\uffff\2\3\1\uffff\1\3\3\uffff";
    static final String DFA8_minS =
        "\1\21\2\5\1\uffff\1\5\1\uffff\2\5";
    static final String DFA8_maxS =
        "\1\21\2\23\1\uffff\1\24\1\uffff\1\6\1\24";
    static final String DFA8_acceptS =
        "\3\uffff\1\1\1\uffff\1\2\2\uffff";
    static final String DFA8_specialS =
        "\10\uffff}>";
    static final String[] DFA8_transitionS = {
            "\1\1",
            "\1\2\1\4\1\uffff\1\3\1\uffff\1\3\2\uffff\2\3\1\uffff\2\3\1\5"+
            "\1\3",
            "\1\2\1\4\1\uffff\1\3\1\uffff\1\3\2\uffff\2\3\1\uffff\2\3\1\uffff"+
            "\1\3",
            "",
            "\1\6\1\7\3\uffff\1\3\2\uffff\2\3\1\uffff\2\3\1\5\2\3",
            "",
            "\1\6\1\7",
            "\1\6\1\7\3\uffff\1\3\2\uffff\2\3\1\uffff\2\3\1\5\2\3"
    };

    static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS);
    static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS);
    static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS);
    static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS);
    static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS);
    static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS);
    static final short[][] DFA8_transition;

    static {
        int numStates = DFA8_transitionS.length;
        DFA8_transition = new short[numStates][];
        for (int i=0; i<numStates; i++) {
            DFA8_transition[i] = DFA.unpackEncodedString(DFA8_transitionS[i]);
        }
    }

    class DFA8 extends DFA {

        public DFA8(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 8;
            this.eot = DFA8_eot;
            this.eof = DFA8_eof;
            this.min = DFA8_min;
            this.max = DFA8_max;
            this.accept = DFA8_accept;
            this.special = DFA8_special;
            this.transition = DFA8_transition;
        }
        public String getDescription() {
            return "25:1: label : ( 'label' phrase | 'label' multi_line_phrase 'endlabel' );";
        }
    }
 

    public static final BitSet FOLLOW_comment_in_grin28 = new BitSet(new long[]{0x00000000000B6522L});
    public static final BitSet FOLLOW_directive_in_grin32 = new BitSet(new long[]{0x00000000000B6522L});
    public static final BitSet FOLLOW_style_definition_in_grin36 = new BitSet(new long[]{0x00000000000B6522L});
    public static final BitSet FOLLOW_8_in_comment45 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_phrase_in_comment47 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_STYLE_TYPE_in_style54 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_9_in_style56 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_phrase_in_style58 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_10_in_inline_style_use64 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_style_in_inline_style_use67 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_11_in_inline_style_use69 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_style_in_inline_style_use73 = new BitSet(new long[]{0x0000000000001800L});
    public static final BitSet FOLLOW_11_in_inline_style_use75 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_12_in_inline_style_use78 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_13_in_style_name85 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_WORD_in_style_name87 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_style_name_in_style_definition93 = new BitSet(new long[]{0x0000000000000400L});
    public static final BitSet FOLLOW_inline_style_use_in_style_definition95 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_inline_style_use_in_style_use101 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_style_name_in_style_use105 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_style_use_in_directive112 = new BitSet(new long[]{0x00000000000B4022L});
    public static final BitSet FOLLOW_text_in_directive116 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_image_in_directive118 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_label_in_directive120 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_play_in_directive122 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_phrase_in_text129 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_14_in_text133 = new BitSet(new long[]{0x0000000000008060L});
    public static final BitSet FOLLOW_multi_line_phrase_in_text135 = new BitSet(new long[]{0x0000000000008000L});
    public static final BitSet FOLLOW_15_in_text137 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_16_in_image143 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_WORD_in_image145 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_phrase_in_image147 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_label153 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_phrase_in_label155 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_17_in_label159 = new BitSet(new long[]{0x0000000000040060L});
    public static final BitSet FOLLOW_multi_line_phrase_in_label161 = new BitSet(new long[]{0x0000000000040000L});
    public static final BitSet FOLLOW_18_in_label164 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_19_in_play170 = new BitSet(new long[]{0x00000000001B6460L});
    public static final BitSet FOLLOW_directive_in_play173 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_NEWLINE_in_play175 = new BitSet(new long[]{0x00000000001B6460L});
    public static final BitSet FOLLOW_20_in_play179 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_WORD_in_phrase187 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_phrase_in_multi_line_phrase196 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_NEWLINE_in_multi_line_phrase198 = new BitSet(new long[]{0x0000000000000062L});
    public static final BitSet FOLLOW_comment_in_synpred128 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_directive_in_synpred232 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_style_definition_in_synpred336 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_style_use_in_synpred7112 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_text_in_synpred8116 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_image_in_synpred9118 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_label_in_synpred10120 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_phrase_in_synpred11129 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_WORD_in_synpred14187 = new BitSet(new long[]{0x0000000000000002L});

}